package top.ajun.common.constants;

/**
 * 库存系统相关常量
 *
 * @author AJun
 * @date 2020/12/9
 */
public interface WareConstant {

    /**
     * 采购单: 新建
     */
    PurchaseStatusEnum PURCHASE_CREATED = PurchaseStatusEnum.CREATED;

    /**
     * 采购单: 已分配
     */
    PurchaseStatusEnum PURCHASE_ASSIGNED = PurchaseStatusEnum.ASSIGNED;

    /**
     * 采购单: 已领取
     */
    PurchaseStatusEnum PURCHASE_RECEIVED = PurchaseStatusEnum.RECEIVED;

    /**
     * 采购单: 已完成
     */
    PurchaseStatusEnum PURCHASE_FINISHED = PurchaseStatusEnum.FINISHED;

    /**
     * 采购单: 有异常
     */
    PurchaseStatusEnum PURCHASE_HAS_ERROR = PurchaseStatusEnum.HAS_ERROR;

    /**
     * 采购单状态
     */
    enum PurchaseStatusEnum {
        CREATED(0, "新建"),
        ASSIGNED(1, "已分配"),
        RECEIVED(2, "已领取"),
        FINISHED(3, "已完成"),
        HAS_ERROR(4, "有异常");

        private final int code;
        private final String msg;

        PurchaseStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 采购需求: 新建
     */
    PurchaseDetailStatusEnum PURCHASE_DETAIL_CREATED = PurchaseDetailStatusEnum.CREATED;

    /**
     * 采购需求: 已分配
     */
    PurchaseDetailStatusEnum PURCHASE_DETAIL_ASSIGNED = PurchaseDetailStatusEnum.ASSIGNED;

    /**
     * 采购需求: 正在采购
     */
    PurchaseDetailStatusEnum PURCHASE_DETAIL_BUYING = PurchaseDetailStatusEnum.BUYING;

    /**
     * 采购需求: 已完成
     */
    PurchaseDetailStatusEnum PURCHASE_DETAIL_FINISHED = PurchaseDetailStatusEnum.FINISHED;

    /**
     * 采购需求: 采购失败
     */
    PurchaseDetailStatusEnum PURCHASE_DETAIL_HAS_ERROR = PurchaseDetailStatusEnum.HAS_ERROR;

    /**
     * 采购需求状态
     */
    enum PurchaseDetailStatusEnum {
        CREATED(0, "新建"),
        ASSIGNED(1, "已分配"),
        BUYING(2, "正在采购"),
        FINISHED(3, "已完成"),
        HAS_ERROR(4, "采购失败");

        private final int code;
        private final String msg;

        PurchaseDetailStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

}
